#ifndef __MARS_PIPELINE_PIPELINE_MGR_H__
#define __MARS_PIPELINE_PIPELINE_MGR_H__

#include "MarsObject.h"
#include "MarsPipelineType.h"

using namespace Core;

namespace Pipeline
{

class MeshImportMgr;
class MeshImporter;

class PipelineMgr : public Object
{
public:
									~PipelineMgr();

	bool							Initialize();
	void							Shutdown();

	static PipelineMgr&				Instance();
	static void						Destroy();

	void							RegisterMeshImportMgr( MeshImportMgr* pMeshImportMgr );
	void							UnRegisterMeshImportMgr( MeshImportType eMeshType );

	MeshImporter*					GetMeshImporter( MeshImportType eMeshType );

private:
									PipelineMgr();
									PipelineMgr( const PipelineMgr& );
	PipelineMgr&					operator = ( const PipelineMgr& );

	static PipelineMgr*				ms_pPipelineMgr;

	typedef std::map< MeshImportType, MeshImportMgr* >	MeshImportMgrMap;
	typedef MeshImportMgrMap::iterator					MeshImportMgrMapItr;
	typedef MeshImportMgrMap::const_iterator			MeshImportMgrMapConstItr;

	MeshImportMgrMap				m_mapMeshImportMgrs;
};

inline PipelineMgr& PipelineMgr::Instance()
{
	if ( !ms_pPipelineMgr )
	{
		ms_pPipelineMgr = new PipelineMgr();
	}

	return ( *ms_pPipelineMgr );
}

} // end of namespace Pipeline

#endif // end of #ifndef __MARS_PIPELINE_PIPELINE_MGR_H__